import Vue from 'vue';

import http from '@src/util/HttpUtil';

import Main from './index.vue';

Vue.prototype.$http = http;

// 处理注入的参数
let initData = {};

try {
  initData = JSON.parse(window._init || '{}') || {};
} catch (error) {
  console.error(error);
  console.error('no init data')
}

let app = {
  provide: {
    initData: Object.freeze(initData),
  },
  render: h => h(Main)
}

export default app;